package com.ruoyi.project.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * 任务提醒规则配置对象 reminder_rules
 * 
 * @author ruoyi
 * @date 2025-06-16
 */
public class ReminderRules extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 关联的任务ID（tasks.id） */
    private Long taskId;

    /** 重复频率类型 */
    @Excel(name = "重复频率类型")
    private String frequency;

    /** 每日提醒时间（如15:00:00） */
    @Excel(name = "每日提醒时间", readConverterExp = "如=15:00:00")
    private Date timeOfDay;

    /** 下次触发提醒的时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "下次触发提醒的时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date nextTrigger;

    /** 每周提醒日[1,2,3,4,5]表示周一到周五 */
    @Excel(name = "每周提醒日[1,2,3,4,5]表示周一到周五")
    private String weeklyDays;

    /** 每月提醒日[1,15]表示每月1号和15号 */
    @Excel(name = "每月提醒日[1,15]表示每月1号和15号")
    private String monthlyDays;

    /** 每年提醒月[1,6,12]表示1月、6月、12月 */
    @Excel(name = "每年提醒月[1,6,12]表示1月、6月、12月")
    private String yearlyMonths;

    /** 每月具体日期[15]表示各月15号 */
    @Excel(name = "每月具体日期[15]表示各月15号")
    private String yearlyDays;

    /** 自定义规则表达式（cron语法） */
    @Excel(name = "自定义规则表达式", readConverterExp = "c=ron语法")
    private String customRule;

    /** 上次触发时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "上次触发时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date lastTriggered;

    /** 规则创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "规则创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /** 最后更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Excel(name = "最后更新时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date updatedAt;

    /** 周期截止：周几（weekly） */
    @Excel(name = "周期截止周几(weekly)")
    private Integer cycleDeadlineWeekDay;
    /** 周期截止：月几号（monthly） */
    @Excel(name = "周期截止月几号(monthly)")
    private Integer cycleDeadlineMonthDay;
    /** 周期截止：几月（yearly） */
    @Excel(name = "周期截止几月(yearly)")
    private Integer cycleDeadlineYearMonth;
    /** 周期截止：几号（yearly） */
    @Excel(name = "周期截止几号(yearly)")
    private Integer cycleDeadlineYearDay;

    public void setTaskId(Long taskId) {
        this.taskId = taskId;
    }

    public Long getTaskId() {
        return taskId;
    }

    public void setFrequency(String frequency) {
        this.frequency = frequency;
    }

    public String getFrequency() {
        return frequency;
    }

    public void setTimeOfDay(Date timeOfDay) {
        this.timeOfDay = timeOfDay;
    }

    public Date getTimeOfDay() {
        return timeOfDay;
    }

    public void setNextTrigger(Date nextTrigger) {
        this.nextTrigger = nextTrigger;
    }

    public Date getNextTrigger() {
        return nextTrigger;
    }

    public void setWeeklyDays(String weeklyDays) {
        this.weeklyDays = weeklyDays;
    }

    public String getWeeklyDays() {
        return weeklyDays;
    }

    public void setMonthlyDays(String monthlyDays) {
        this.monthlyDays = monthlyDays;
    }

    public String getMonthlyDays() {
        return monthlyDays;
    }

    public void setYearlyMonths(String yearlyMonths) {
        this.yearlyMonths = yearlyMonths;
    }

    public String getYearlyMonths() {
        return yearlyMonths;
    }

    public void setYearlyDays(String yearlyDays) {
        this.yearlyDays = yearlyDays;
    }

    public String getYearlyDays() {
        return yearlyDays;
    }

    public void setCustomRule(String customRule) {
        this.customRule = customRule;
    }

    public String getCustomRule() {
        return customRule;
    }

    public void setLastTriggered(Date lastTriggered) {
        this.lastTriggered = lastTriggered;
    }

    public Date getLastTriggered() {
        return lastTriggered;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setCycleDeadlineWeekDay(Integer cycleDeadlineWeekDay) {
        this.cycleDeadlineWeekDay = cycleDeadlineWeekDay;
    }

    public Integer getCycleDeadlineWeekDay() {
        return cycleDeadlineWeekDay;
    }

    public void setCycleDeadlineMonthDay(Integer cycleDeadlineMonthDay) {
        this.cycleDeadlineMonthDay = cycleDeadlineMonthDay;
    }

    public Integer getCycleDeadlineMonthDay() {
        return cycleDeadlineMonthDay;
    }

    public void setCycleDeadlineYearMonth(Integer cycleDeadlineYearMonth) {
        this.cycleDeadlineYearMonth = cycleDeadlineYearMonth;
    }

    public Integer getCycleDeadlineYearMonth() {
        return cycleDeadlineYearMonth;
    }

    public void setCycleDeadlineYearDay(Integer cycleDeadlineYearDay) {
        this.cycleDeadlineYearDay = cycleDeadlineYearDay;
    }

    public Integer getCycleDeadlineYearDay() {
        return cycleDeadlineYearDay;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("taskId", getTaskId())
                .append("frequency", getFrequency())
                .append("timeOfDay", getTimeOfDay())
                .append("nextTrigger", getNextTrigger())
                .append("weeklyDays", getWeeklyDays())
                .append("monthlyDays", getMonthlyDays())
                .append("yearlyMonths", getYearlyMonths())
                .append("yearlyDays", getYearlyDays())
                .append("customRule", getCustomRule())
                .append("lastTriggered", getLastTriggered())
                .append("createdAt", getCreatedAt())
                .append("updatedAt", getUpdatedAt())
                .append("cycleDeadlineWeekDay", getCycleDeadlineWeekDay())
                .append("cycleDeadlineMonthDay", getCycleDeadlineMonthDay())
                .append("cycleDeadlineYearMonth", getCycleDeadlineYearMonth())
                .append("cycleDeadlineYearDay", getCycleDeadlineYearDay())
                .toString();
    }
}
